package com.ljw.controller;


import com.ljw.entity.Type;
import com.ljw.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 客房型号表 前端控制器
 * </p>
 *
 * @author ljw
 * @since 2020-07-25
 */
@RestController
@RequestMapping("/type")
public class TypeController {

    @Autowired
    private TypeService typeService;

    @GetMapping("/findAll")
    public List<Type> findAll(){
        return typeService.list();
    }

    @PostMapping("/update")
    public String update(@RequestBody Type type){
        boolean b = typeService.updateById(type);
        return b?"OK":"ERROR";
    }

}

